package whu.cn.whushare.ui.main.activity.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import java.util.List;

import whu.cn.whushare.R;
import whu.cn.whushare.ui.main.activity.bean.SearchActivity;
import whu.cn.whushare.ui.main.known.bean.SearchQuestion;

/**
 * Created by xiaoping on 2015/4/9.
 */
public class SearchActivityAdapter  extends BaseAdapter {
    private Context mContext;
    private List<SearchActivity> mHis;

    public SearchActivityAdapter(Context mContext, List<SearchActivity> mHis) {
        this.mContext = mContext;
        this.mHis = mHis;
    }

    @Override
    public int getCount() {
        return mHis.size();
    }

    @Override
    public Object getItem(int position) {
        return mHis.get(position);
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        if (convertView == null) {
            convertView = LayoutInflater.from(mContext).inflate(R.layout.layout_search_history_item, null);
            TextView textView=(TextView)convertView.findViewById(R.id.search_history);
            textView.setText(mHis.get(position).activity.getActivityName());
        }


        return convertView;
    }


}
